<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="../../js/usual.js"></script>

<link type ="text/css" rel="stylesheet" href="../../css/user-search.css"/>
<title>store</title>
<style>
	
	
</style>
</head>
<body style="margin:0;">
	<div class="header">
		<span class="customer_account">
			hellosssssssssxxxxxxxxxxxxxxx
		</span>
		<img src="../../images/cart1.png"/>
		<span class="cart">			
			购物车
		</span>	
		<div style="clear:both;"></div>
	</div>
	<div class="search_div">
		<div class="sclogo">
			<img src="../../images/logo.png">
		</div>
		
		<div class="search">
				<input class="hidden_search" type="hidden" value="宝贝" />
				<select class="select">
					<option>宝贝</option>
					<option>商铺</option>
				</select>
				<input class="search_text" type="text" value="" placeholder="请输入您要搜索的商品" />
				<div class="carema">
					<img src="../../images/camera.jpg"  />
				</div>
				<input class="search_btn" type="button" value="搜索" />
		</div>

	</div>
	<div class="content">
		<div class="classify">
			<div class="class1">
				<span>综合排序</span>
			</div>
			<div class="class1">
				<span>销量</span>
			</div>
			<div class="class1">
				<span>信用</span>
			</div>
			<div class="class1">
				<select class="select_price">
					<option>价格从低到高</option>
					<option>价格从高到低</option>
				</select>
			</div>
			
			<div style="clear:both;"></div>
		</div>
		
		
		<div class="classify_show">
			
			<div class="good_show">
				<img src="../../images/good1.jpg" />
				<span class="span_price">￥18.00 </span>
				<span class="span_name"><a href="">sdfghjhgfdsdfghj </a></span>
				<span class="span_business"><a href="">升级炒肝</a></span>
			</div>
			<div class="good_show">
				<img src="../../images/good2.jpg" />
				<span class="span_price">￥25.00 </span>
				<span class="span_name"><a href="">sdfghjhgfdsdfghj </a></span>
				<span class="span_business"><a href="">升级炒肝</a></span>
			</div>
			<div class="good_show">
				<img src="../../images/good3.jpg" />
				<span class="span_price">￥15.00 </span>
				<span class="span_name"><a href="">sdfghjhgfdsdfghj </a></span>
				<span class="span_business"><a href="">升级炒肝</a></span>
			</div>
			<div class="good_show">
				<img src="../../images/good4.jpg" />
				<span class="span_price">￥33.00 </span>
				<span class="span_name"><a href="">sdfghjhgfdsdfghj </a></span>
				<span class="span_business"><a href="">升级炒肝</a></span>
			</div>
			<div class="good_show">
				<img src="../../images/good5.jpg" />
				<span class="span_price">￥11.00 </span>
				<span class="span_name"><a href="">sdfghjhgfdsdfghj </a></span>
				<span class="span_business"><a href="">升级炒肝</a></span>
			</div>
			
		</div>
		
	</div>
<script>

var data1={
		 "type":"best_goods"
};

$.ajax({
       type:"get",
       url: "http://localhost:8080/shop/html/usersearch",
       data: data1,
       cache: false,
       async : false,
       success: function (data ,textStatus, jqXHR)
       {

       	//alert(data[0]);
       	//<li><a href=""><span>hellohellohellohellohellohellohellohellohello</span></a></li>
       	for(var i=0;i<data.length;i++){
       		$('.classify_show').append('<div class="good_show">'
    				+'<img src="../../images/'+data[i][0]+'" />'
    				+'<span class="span_price">￥'+data[i][1]+' </span>'
    				+'<span class="span_name"><a href="">'+data[i][2]+' </a></span>'
    				+'<span class="span_business"><a href="">'+data[i][3]+'</a></span>'
    				+'</div>');
       	}
       },
       error:function (XMLHttpRequest, textStatus, errorThrown) {      
       	//alert("发生错误");
       }
   });

$('.select').click(function(){
	if( $('.select').val()=="宝贝"){
		 $('.hidden_search').val("宝贝");
			$('.search_text').attr("placeholder","请输入您要搜索的商品");
	}
	
	if( $('.select').val()=="商铺"){
		 $('.hidden_search').val("商铺");
			$('.search_text').attr("placeholder","请输入您要搜索的商铺");
	}
});
</script>
</body>
</html>